package halberd;

import java.util.LinkedList;
import java.util.List;

import halberd.data.ImgData;

public class FilterChain {
	private List<ImgFilter> filters = new LinkedList<ImgFilter>();

	public void add(ImgFilter filter) {
		filters.add(filter);
	}

	public void clear() {
		filters.clear();
	}

	public ImgData process(ImgData imgData) {
		ImgData input = imgData;
		for (ImgFilter imgFilter : filters) {
			input = imgFilter.process(input);
		}
		return input;
	}
}
